import 'package:flutter/material.dart';
import 'package:flutter_order_food/constants.dart';
import 'package:flutter_order_food/model/model.dart';
import 'package:flutter_order_food/screens/detail/detail_screen.dart';
import 'package:flutter_svg/flutter_svg.dart';

class ShopItemCard extends StatelessWidget {
  final ShopCard shop;
  const ShopItemCard({Key key, this.shop}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    Size size = MediaQuery.of(context).size;
    return Container(
      margin: EdgeInsets.only(top: 20, bottom: 20, left: 20, right: 15),
      decoration: BoxDecoration(
          color: Colors.white,
          borderRadius: BorderRadius.circular(10),
          boxShadow: [
            BoxShadow(
              offset: Offset(0, 4),
              blurRadius: 20,
              color: Color(0xffb0cce1).withOpacity(0.32),
            ),
          ]),
      child: Material(
        color: Colors.transparent,
        child: InkWell(
          onTap: () {
            Navigator.push(
              context,
              MaterialPageRoute(
                builder: (context) => DetailScreen(),
              ),
            );
          },
          child: Padding(
            padding: EdgeInsets.all(20),
            child: Column(
              children: [
                Container(
                  margin: EdgeInsets.only(
                    bottom: 15,
                  ),
                  padding: EdgeInsets.all(25),
                  decoration: BoxDecoration(
                    color: kPrimaryColor.withOpacity(0.13),
                    shape: BoxShape.circle,
                  ),
                  child:
                      SvgPicture.asset(shop.svgSrc, width: size.width * 0.18),
                ),
                Text(shop.title),
                SizedBox(height: 10),
                Text(
                  shop.shopName,
                  style: TextStyle(fontSize: 12),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
